package com.yaxin.outsourcing.service;

import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yaxin.common.core.domain.PageQuery;
import com.yaxin.common.core.page.TableDataInfo;
import com.yaxin.outsourcing.domain.po.OutsourcingPerson;
import com.yaxin.outsourcing.domain.dto.AccessApplicationDTO;
import com.yaxin.outsourcing.domain.po.AccessApplication;
import com.yaxin.outsourcing.domain.vo.AccessApplicationDetailVO;


import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;

public interface IAccessApplicationService extends IService<AccessApplication> {
    // 查询申请单
    TableDataInfo<AccessApplication> appList(AccessApplication accessApplication, PageQuery pageQuery) ;

    // 新增申请单
    int createApplication(@Valid AccessApplicationDTO dto);

    // 修改申请单
    void updateApplication(Long id, @Valid AccessApplicationDTO dto);

    // 删除申请单
    void deleteApplication(List<Long> ids);

    // 根据申请单号删除相关人员
    void deletePerson(String appNo);

    // 获取申请单详情
    AccessApplicationDetailVO getApplicationDetail(Long id);

    String generateApplicationNo();

    int updateStatus(Long id, Integer status);

    //查找appid树
    List<Tree<Long>> selectAppIdTreeList(String userName);

    List<OutsourcingPerson> getPersonListByAppId(Long id);

    //根据申请单号修改状态
    void updateStatusByAppNo(String appNo, Integer status);

    //发送已审批的人员
    public void sendMqMessage(String appNo);

    void createQRCode(String name,String appNo, HttpServletResponse response);
}
